package lab01;

import java.util.Scanner;

public class Test12 {
    public static void main(String[] args) {
        System.out.println("请输入一个1-9999之间的数");
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();

        int gw,sw,bw,qw;
        int count = 0;
        qw = x/1000;
        bw = (x%1000)/100;
        sw = (x%100)/10;
        gw = x%10;

        if(qw!=0){
            count = 4;
        }else if(bw != 0){
            count = 3;
        }else if(sw != 0){
            count = 2;
        }else {
            count = 1;
        }

        System.out.println(x+"是"+count+"位数！");

        if((qw*1+bw*10+sw*100+gw*1000) == x){//判断回文并输出相关信息
            System.out.println(x+"是回文!");
        }else{
            System.out.println(x+"不是回文！");
        }

        System.out.println(x+"的千位是："+qw+"百位是："+bw+"十位是："+sw+"个位是："+gw);




    }
}
